package com.example.cinema.bindingdata;

import android.util.Log;
import android.view.View;
import android.widget.ImageView;

import androidx.databinding.BindingAdapter;
import androidx.databinding.ObservableField;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.example.cinema.R;

public class FollowFansData {


    @BindingAdapter("ffimage")
    public static void Images(View view,String url)
    {
        if(view!=null&&url!=null)
        {
            Log.i("KHKH",url);
            RequestOptions options = new RequestOptions()
                    .placeholder(R.mipmap.defaut_img)
                    .error(R.mipmap.defaut_img)
                    .fallback(R.mipmap.defaut_img);
            Glide.with(view).load(url)
                    .apply(options)
                    .into((ImageView) view);
        }
    }



    public ObservableField<String> image = new ObservableField<>();//图片
    public ObservableField<String> userm = new ObservableField<>();//作者
    public ObservableField<String> uimge = new ObservableField<>();//作者头像
    public ObservableField<String> shorturl  = new ObservableField<>();//作品播放地址(短视频)
    public ObservableField<String> playurl  = new ObservableField<>();//作品播放地址(完整视频)
    public ObservableField<String> videoid = new ObservableField<>();//视频ID
}
